package com.txzt.gaea.common.enums;

public enum ProjectStatus {

    /**
     * 未开题
     */
    INIT(0,"未开题"),
    /**
     * 开题审核中
     */
    OPEN_CHECK(10,"开题审核中"),
    /**
     * 已开题
     */
    OPEN(2,"已开题"),
    /**
     * 结题审核中
     */
    FINISH_CHECK(30,"结题审核中"),
    /**
     * 已结题
     */
    FINISH(4,"已结题"),
    /**
     * 延期审核中
     */
    DELAY_CHECK(50,"延期审核中"),
    /**
     * 延期
     */
    DELAY(6,"延期"),
    /**
     * 中止审核中
     */
    STOP_CHECK(70,"中止审核中"),
    /**
     * 中止
     */
    STOP(8,"中止"),
    /**
     * 退回修改
     */
    BACK(9,"退回修改"),
    /**
     * 不通过
     */
    REJECT(99,"不通过"),
    ;

    private final Integer code;

    private final String info;

    ProjectStatus(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }


    public static String getInfoByCode(Integer code){
        ProjectStatus[] statuses = values();
        for (ProjectStatus status:statuses){
            if (status.getCode().equals(code)) {
                return status.getInfo();
            }
        }
        return "";
    }
}
